package net.shopxx.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

/**
 * 实体类 - 商品评论
 */

@Entity
public class ProductComment extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1662945113349789807L;
	public static final Integer MAX_COMMENT_COUNT = 10;
	private String title;// 评论标题
	private Integer rank; // 评论等级
	private String experience;// 使用心得
	private String advantage;// 优点
	private String shortcoming;// 缺点
	private Boolean status;// 是否前台显示
	private Member member;// 评论的会员
	private Product product;// 评论的产品

	@Column(length = 40)
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getRank() {
		return rank;
	}

	public void setRank(Integer rank) {
		this.rank = rank;
	}

	@Column(length = 500)
	public String getExperience() {
		return experience;
	}

	public void setExperience(String experience) {
		this.experience = experience;
	}

	@Column(length = 255)
	public String getAdvantage() {
		return advantage;
	}

	public void setAdvantage(String advantage) {
		this.advantage = advantage;
	}

	@Column(length = 255)
	public String getShortcoming() {
		return shortcoming;
	}

	public void setShortcoming(String shortcoming) {
		this.shortcoming = shortcoming;
	}

	@Column(nullable = false)
	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(nullable = false)
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(nullable = false)
	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

}